package com.cdm.persistence;

import java.util.Date;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * CdmContentUse entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "cdm_content_use", catalog = "cdm", uniqueConstraints = {})
public class ContentUse implements java.io.Serializable {

	// Fields

	private ContentUseId id;
	private Date orderTime;
	private Long licenseType;
	private Date expireTime;

	// Constructors

	/** default constructor */
	public ContentUse() {
	}

	/** full constructor */
	public ContentUse(ContentUseId id, Date orderTime, Long licenseType, Date expireTime) {
		this.id = id;
		this.orderTime = orderTime;
		this.licenseType = licenseType;
		this.expireTime = expireTime;
	}

	// Property accessors
	@EmbeddedId
	@AttributeOverrides( {
	        @AttributeOverride(name = "licenseId", column = @Column(name = "license_id", unique = false, nullable = false, insertable = true, updatable = true)),
	        @AttributeOverride(name = "dcid", column = @Column(name = "dcid", unique = false, nullable = false, insertable = true, updatable = true)),
	        @AttributeOverride(name = "spid", column = @Column(name = "spid", unique = false, nullable = false, insertable = true, updatable = true)) })
	public ContentUseId getId() {
		return this.id;
	}

	public void setId(ContentUseId id) {
		this.id = id;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "order_time", unique = false, nullable = false, insertable = true, updatable = true, length = 19)
	public Date getOrderTime() {
		return this.orderTime;
	}

	public void setOrderTime(Date orderTime) {
		this.orderTime = orderTime;
	}

	@Column(name = "license_type", unique = false, nullable = false, insertable = true, updatable = true)
	public Long getLicenseType() {
		return this.licenseType;
	}

	public void setLicenseType(Long licenseType) {
		this.licenseType = licenseType;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "expire_time", unique = false, nullable = false, insertable = true, updatable = true, length = 19)
	public Date getExpireTime() {
		return this.expireTime;
	}

	public void setExpireTime(Date expireTime) {
		this.expireTime = expireTime;
	}

}